<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2018/3/6
  Time: 18:26
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@include file="../../../base.jsp" %>
<%--<button type="button" class="btn btn-default " onclick="paper.goBack(${growthId})">--%>
<%--&lt;返回--%>
<%--</button>--%>
<div class="modal-header">
    <h1 class="text-left text-primary">
        试卷
        <c:if test="${paper.status == 0}">
            <i style="color: black">[未发布]</i>
        </c:if>
        <c:if test="${paper.status == 50}">
            <i style="color: green">[已发布]</i>
        </c:if>
        <c:if test="${paper.status == 99}">
            <i style="color: red">[已废除]</i>
        </c:if>
        <button type="button" class="btn btn-danger " onclick="paper.editPaper('${paper.paperId}')">
            修改
        </button>
    </h1>

    <form id="paperForm"
          class="form-horizontal text-left editForm">
        <input class="hidden" value="${growthId}" name="paper.growthId">
        <input class="hidden" value="${paper.paperId}" name="paper.paperId">
        <div class="form-group">
            <label class="col-sm-1 control-label">试卷描述</label>
            <div class="col-sm-8">
                <p class="form-control-static">${paper.descr}</p>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-1 control-label">tips</label>
            <div class="col-sm-8">
                <p class="form-control-static">${paper.tips}</p>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-1 control-label">排序号</label>
            <div class="col-sm-8">
                <p class="form-control-static">${paper.rank}</p>
            </div>
        </div>

    </form>
</div>
<br>

<h4 class="text-primary">
    试题列表
    <button type="button" class="btn btn-danger " onclick="paper.editQuestion(null,'${paper.paperId}')">
        添加试题
    </button>
</h4>
<%--<div class="form-group">--%>
<%--<div class="col-sm-8">--%>
<div class="list-group">
    <c:forEach items="${questionList}" var="questionVo" varStatus="vs">

        <p class="form-control-static list-group-item active">
            <button class="btn btn-danger btn-xs glyphicon glyphicon-pencil"
                    onclick="paper.editQuestion('${questionVo.paperQuestion.questionId}')">
            </button>
            <c:if test="${questionVo.paperQuestion.status == 99}">
                <i style="color: red;">[已废除]</i>
            </c:if>
            <c:if test="${questionVo.paperQuestion.status == 50}">
                <i style="color: #00ff00;">[已发布]</i>
            </c:if>
            <c:if test="${questionVo.paperQuestion.status == 0}">
                <i style="color: black;">[未发布]</i>
            </c:if>
                ${questionVo.paperQuestion.questionContent}
        </p>
        <p class="form-control-static list-group-item active">排序号：${questionVo.paperQuestion.rank}</p>
        <%--<p class="form-control-static">答案选项:</p>--%>
        <c:forEach items="${questionVo.optionList}" var="option" varStatus="optionVS">
            <div class="list-group-item">
                <p class="form-control-static bg-success"><strong
                        style="color: black;">答案内容----</strong>${option.content}</p>
                <p class="form-control-static bg-warning"><strong
                        style="color: black;">结果分析----</strong>${option.analysis}</p>
                <p class="form-control-static bg-info "><strong style="color: black;">选项得分----</strong>${option.score}
                </p>
                <p class="form-control-static bg-info "><strong style="color: black;">排序号----</strong>${option.rank}</p>
                <c:if test="${option.status == 99}">
                    <i style="color: red;">[答案选项已废除]</i>
                </c:if>
                <c:if test="${option.status == 50}">
                    <i style="color: green;">[已发布]</i>
                </c:if>
                <c:if test="${option.status == 0}">
                    <i style="color: black;">[未发布]</i>
                </c:if>
                <button class="btn btn-danger btn-xs glyphicon glyphicon-pencil"
                        onclick="paper.editOption('${option.optionId}',null)"></button>

            </div>
        </c:forEach>
        <div class="list-group-item">
            <button class="btn btn-danger btn-xs glyphicon glyphicon-plus"
                    onclick="paper.editOption(null,'${questionVo.paperQuestion.questionId}')">添加答案
            </button>
        </div>
        <br>
    </c:forEach>
</div>
<%--</div>--%>
<%--</div>--%>

<script src="${basePath}js/paper_js/paper.js"></script>
